package com.xuecheng.api.client;

import com.xuecheng.api.client.fallback.ContentClientFallBackFactory;
import com.xuecheng.api.dto.CoursePublish;
import com.xuecheng.api.dto.TeachPlanAndMediaDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author 勾新杰
 * @version 1.0
 * @description: 内容服务客户端
 * @date 2025/2/26 13:14
 */
@FeignClient(value = "content-api", fallbackFactory = ContentClientFallBackFactory.class, path = "/content")
public interface ContentClient {

    /**
     * 根据课程id获取课程发布信息
     * @param courseId 课程id
     * @return 课程发布信息
     */
    @GetMapping("/course-publish/{courseId}")
    CoursePublish getById(@PathVariable("courseId") Long courseId);

    /**
     * 根据课程计划id查询课程媒资信息
     *
     * @param teachplanId 课程计划id
     * @return 课程媒资信息
     */
    @GetMapping("/teach-plan/{teachplanId}")
    TeachPlanAndMediaDTO getTeachPlanAndMedia(@PathVariable("teachplanId") Long teachplanId);
}

